package com.lagou.rpc.consumer.controller;

import com.lagou.rpc.api.IUserService;
import com.lagou.rpc.consumer.anno.RpcAutowired;
import com.lagou.rpc.pojo.User;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @RpcAutowired
    private IUserService userService;

    @RequestMapping("/{id}")
    public User selectById(@PathVariable("id") int id) {
        return userService.getById(id);
    }
}
